#!/usr/bin/php
<?php
#commentify: jhead EXIF-comment setter
#(C) Copyright 2010 Nicholas Paun. All Rights Reserved.

$dir = glob("*.{jpg,JPG,jpeg,JPEG}",GLOB_BRACE);

foreach($dir as $photo)
 {
  $oldtime = filemtime($photo);
  $comment = readline("Captionate! ");
  passthru("jhead -cl '$comment' $photo");
  touch($photo,$oldtime);
  }
?>
